﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Adams.Web.Areas.MyAdams.Logic.Profile
{
    public static class General
    {
        public static MyAdams.Models.Profile.General.PageLoad PageLoad(int memberId)
        {
            return MyAdams.Data.Profile.General.PageLoad(memberId);
        }

        public static Adams.Web.Models.FormOutput SaveGeneral(int memberId, Adams.Web.Areas.MyAdams.Models.Profile.General.FormInput input)
        {
            var output = Adams.Web.Logic.Validation.PerformBasicValidation(input);

            if (output.IsValid)
            {
                MyAdams.Data.Profile.General.SaveGeneral(memberId, input);
                output.IsSaved = true;
            }

            return output;
        }
    }
}